home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * rminfo_svcproc.c --
- *
- * This routine performs the "guts" of the rminfo daemon.
- * It's called from the RPC dispatch routine in rminfo_svc.c
- */
-
- #include <sys/param.h>
- #include <sys/sysmp.h>
- #include <sys/sysmacros.h>
- #include <errno.h>
- #include <rpc/rpc.h>
- #define _RPCGEN_SVC
- #include "rminfo.h"
-
- rminfo1 *
- rminfoproc_get_1(void *v, struct svc_req *rq)
- {
- static rminfo1 rm;
- int rminfosz;
- struct rminfo ri;
-
- /*
- * Ask the IRIX kernel for the info, then convert the values
- * from pages to bytes.
- */
- rminfosz = sysmp(MP_SASZ, MPSA_RMINFO);
- if (sysmp(MP_SAGET, MPSA_RMINFO, (char *) &ri, rminfosz) < 0)
- return NULL;
- rm.freemem = ctob(ri.freemem);
- rm.availsmem = ctob(ri.availsmem);
- rm.availrmem = ctob(ri.availrmem);
- rm.bufmem = ctob(ri.bufmem);
- rm.physmem = ctob(ri.physmem);
- rm.delwri = ctob(ri.delwri);
-
- #ifdef DEBUG
- printf("free %d, avails %d, availr %d, buf %d, physmem %d, delwri %d\n",
- rm.freemem, rm.availsmem, rm.availrmem, rm.bufmem, rm.physmem, rm.delwri);
- #endif
- return &rm;
- }
-